{% extends 'template.html' %}

{% block username %}
    {{ head.username }}
{% endblock %}

{% block content %}
    <div id="page-wrapper">
        <div class="row">
            <div class="col-lg-12">
                <h1 class="page-header">{{ head.value }}</h1>
            </div>
        </div>
        <div class="row">
            <div class="col-lg-12">
                <div class="panel panel-default">
                    <div class="panel-body">
                        <div id="example-basic">
                            <h3>Let's do this</h3>
                            <section>
                                <form role="form" class="form-horizontal">
                                    <div class="form-group">
                                        <label class="col-sm-12" for="TextArea">标题*</label>
                                        <div class="col-sm-6">
                                            <input class="form-control" id="title"></input>
                                        </div>
                                        <div class="alert alert-danger col-sm-4" id="show_title_msg"
                                             style="display: none;">
                                            请输入前端热更新标题!
                                        </div>
                                        <div class="alert alert-danger col-sm-4" id="show_title_len_msg"
                                             style="display: none;">
                                            前端热更新标题超过255个字节!
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-12" for="TextArea">原因(可选)</label>
                                        <div class="col-sm-6">
                                            <textarea class="form-control" id="reason" rows="10"
                                                      placeholder="可选填"></textarea>
                                        </div>
                                        <div class="alert alert-danger col-sm-4" id="show_reason_msg"
                                             style="display: none;">
                                            请输入前端热更新原因!
                                        </div>
                                    </div>
                                    <div class="form-group" style="display: none">
                                        <label class="col-sm-12" for="TextArea">注意事项(可选)</label>
                                        <div class="col-sm-6">
                                            <textarea class="form-control" id="attention" rows="10"></textarea>
                                        </div>
                                    </div>
                                </form>
                            </section>
                            <h3>确定项目地区和审批人</h3>
                            <section>
                                <form role="form" class="form-horizontal">

                                    <!--<div class="form-group" id="show_client_type">
                                <label class="col-sm-12" for="TextArea">客户端类型</label>
                                  <div class="col-sm-6">
                                    <select id="client_type" style="width: 100%">
                                      {% for client_type in data.client_types %}
                                        {% if forloop.first %}
                                          <option value={{client_type}} selected="selected">{{client_type}}</option>
                                        {% else %}
                                          <option value={{client_type}}>{{client_type}}</option>
                                        {% endif %}
                                      {% endfor %}
                                    </select>
                                  </div>
                              </div>-->

                                    <div class="form-group">
                                        <label class="col-sm-12" for="TextArea">区域</label>
                                        <div class="col-sm-6">
                                            <select id="area" style="width: 100%">
                                                <option value="0" selected="selected">选择区域</option>
                                            </select>
                                        </div>
                                        <div class="alert alert-danger col-sm-4" id="show_area_msg"
                                             style="display: none;">
                                            请选择前端热更新地区!
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-12" for="TextArea">指定备用主程审批人(防止主程请假不能审批的情况)</label>
                                        <div class="col-sm-6">
                                            <select id="backup_dev" style="width: 100%">
                                                <option value="0" selected="selected">选择备用主程审批人</option>
                                            </select>
                                        </div>
                                        <div class="alert alert-danger col-sm-4" id="show_backup_dev_msg"
                                             style="display: none;">
                                            请选择备用的主程审批人!
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-12"
                                               for="TextArea">指定测试或策划负责人审批(可多选,可不选,如果不选,则自己会自动完成测试审批)</label>
                                        <div class="col-sm-6">
                                            <select id="test_head" style="width: 100%">
                                                <!--<option value="0" selected="selected">选择测试负责人</option>-->
                                            </select>
                                        </div>
                                        <div class="alert alert-danger col-sm-4" id="show_test_head_msg"
                                             style="display: none;">
                                            请选择至少一个前端热更新测试负责人!
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-12" for="TextArea">指定运营负责人审批(可多选)</label>
                                        <div class="col-sm-6">
                                            <select id="operation_head" style="width: 100%">
                                                <!--<option value="0" selected="selected">选择运营负责人</option>-->
                                            </select>
                                        </div>
                                        <div class="alert alert-danger col-sm-4" id="show_operation_head_msg"
                                             style="display: none;">
                                            请选择至少一个前端热更新运营负责人!
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-12" for="TextArea">更新完成后额外通知人员</label>
                                        <div class="col-sm-6">
                                            <select id="extra" style="width: 100%">
                                                <!--<option value="0" selected="selected">选择运营负责人</option>-->
                                            </select>
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="col-sm-12" for="TextArea">更新完成后额外通知组员</label>
                                        <div class="col-sm-6">
                                            <select id="extra_project_group" style="width: 100%">
                                                <!--<option value="0" selected="selected">选择运营负责人</option>-->
                                            </select>
                                        </div>
                                    </div>
                                </form>
                            </section>
                            <h3>选择更新版本和CDN</h3>
                            <section>
                                <form role="form" class="form-horizontal" id="append_create_update_version">
                                    <div class="form-group" id='create_update_version'>
                                        <label class="col-sm-1">添加更新条目</label>
                                        <button type="button" id="bt-add" class="btn btn-outline btn-primary btn-xs">
                                            获取
                                        </button>
                                    </div>

                                </form>
                            </section>
                            <h3>选择前端热更新文件列表</h3>
                            <section>
                                <form>
                                    <div class="form-group row">
                                        <label class="col-sm-1 col-form-label" for="file_area_name">地区</label>
                                        <div class="col-sm-2">
                                            <input type="text" readonly class="form-control" id="file_area_name">
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <label class="col-sm-1 col-form-label" for="file_version">版本号</label>
                                        <div class="col-sm-2">
                                            <input type="text" readonly class="form-control" id="file_version">
                                        </div>
                                    </div>
                                    <div class="form-group row" id="add_file_after">
                                        <div class="col-sm-1">
                                            <a>
                                                <button id='bt-require-file' type="button" class="btn btn-success">
                                                    获取文件列表
                                                </button>
                                            </a>
                                        </div>
                                        <div class="alert alert-danger col-sm-4" id="show_file_list_msg"
                                             style="display: none;">
                                            你没有选择热更新文件!
                                        </div>
                                        <!--<div class="col-sm-1">
                                            <a><button id='bt-remove-file' type="button" class="btn btn-danger">清空文件列表</button></a>
                                        </div>-->
                                        <div class="alert alert-danger col-sm-4" id="show_title_msg"
                                             style="display: none;">
                                            请输入前端热更新标题!
                                        </div>
                                    </div>
                                </form>
                            </section>
                            <h3>是否和后端热更新一起绑定</h3>
                            <section>
                                <form role="form" class="form-horizontal">
                                    <div class="form-group">
                                        <label class="col-sm-12" for="TextArea">加入已经创建好的后端热更新代号(和创建互斥)</label>
                                        <div class="col-sm-6">
                                            <select id="select_pair_code" style="width: 100%">
                                                <option value="0" selected="selected">选择加入</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-12"
                                               for="TextArea">创建一个新的代号(如果没有找到匹配的后端热更新代号)(和加入互斥)</label>
                                        <div class="col-sm-6">
                                            <input type="text" readonly class="form-control" id="gen_pair_code">
                                        </div>
                                        <a>
                                            <button id='bt-gen' type="button" class="btn btn-primary">生成代号</button>
                                        </a>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-12" for="TextArea">执行的先后顺序</label>
                                        <div class="col-sm-6">
                                            <select id="order" style="width: 100%">
                                                <option value="无" selected="selected">选择先后顺序</option>
                                                <option value="先">先</option>
                                                <option value="后">后</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="alert alert-danger col-sm-4" id="show_pair_code_msg"
                                         style="display: none;">
                                        请选择绑定代号和先后顺序，都要选择
                                    </div>
                                </form>
                            </section>
                            <h3>确认提交</h3>
                            <section>
                                <form role="form" class="form-horizontal">
                                    <div class="form-group">
                                        <label class="col-sm-12" for="TextArea">
                                            **请仔细确认本次端热更新的信息**
                                        </label>
                                    </div>
                                    <div class="form-group" id="test2">
                                        <label class="col-sm-12" for="TextArea">
                                            标题
                                        </label>
                                        <div class="col-sm-6">
                                            <input class="form-control" id="overview_title" readonly="readonly"></input>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-12" for="TextArea">
                                            原因
                                        </label>
                                        <div class="col-sm-6">
                                            <textarea class="form-control" id="overview_reason" readonly="readonly"
                                                      rows="5"></textarea>
                                        </div>
                                    </div>
                                    <div class="form-group" style="display: none">
                                        <label class="col-sm-12" for="TextArea">
                                            注意事项
                                        </label>
                                        <div class="col-sm-6">
                                            <textarea class="form-control" id="overview_attention" readonly="readonly"
                                                      rows="10"></textarea>
                                        </div>
                                    </div>
                                    <br>
                                    <div class="form-group row">
                                        <label class="col-sm-12" for="TextArea">
                                            地区版本号
                                        </label>
                                        <div class="col-sm-2">
                                            <input type="text" readonly class="form-control" id="overview_area">
                                        </div>
                                        <div class="col-sm-2">
                                            <input type="text" readonly class="form-control"
                                                   id="overview_update_version">
                                        </div>
                                    </div>
                                    <div class="form-group" id="add_overview_cdn_version_before" style="display: none;">
                                        <label class="col-sm-12" for="TextArea">
                                            test
                                        </label>
                                        <div class="col-sm-6">
                                            <input class="form-control" readonly="readonly">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-12" for="TextArea">
                                            和后端一起绑定热更新及先后顺序
                                        </label>
                                        <div class="col-sm-3">
                                            <input class="form-control" id="overview_pair_code"
                                                   readonly="readonly">
                                        </div>
                                        <div class="col-sm-3">
                                            <input class="form-control" id="overview_order" readonly="readonly"></input>
                                        </div>
                                    </div>
                                </form>
                            </section>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
{% endblock %}
{% block bodyjs %}
    <script src="/static/js/jquery.steps.js"></script>
    <script src="/static/js/common_client_hot_update_workflow.js?v=20191105001"></script>
    <script src="/static/js/flatpickr.js"></script>
    <script src="/static/js/zh.js"></script>
    <script src="/static/js/jquery.tree-multiselect.js"></script>
    <script src="/static/js/jquery.dataTables.js"></script>
    <script src="/static/js/md5.min.js"></script>
{% endblock %}
{% block css %}
    <link href="/static/css/jquery.steps.css" rel="stylesheet" type="text/css">
    <link href="/static/css/flatpickr.css" rel="stylesheet" type="text/css">
    <link href="/static/css/jquery.tree-multiselect.css" rel="stylesheet" type="text/css">
    <link href="/static/css/dataTables.colVis.css" rel="stylesheet" type="text/css">
    <link href="/static/css/jquery.dataTables.css" rel="stylesheet" type="text/css">
    <link href="/static/css/client_hot_update.css" rel="stylesheet" type="text/css">
{% endblock %}
